<div class="file-version-container">

    <div class="left">
        <nz-card [nzBordered]="false" nzTitle="工程列表">
            <div class="form-wrap">
                <form nz-form [nzLayout]="'inline'" [formGroup]="searchForm1">
                    <nz-form-item>
                        <nz-form-label>工程类型</nz-form-label>
                        <nz-form-control>
                            <nz-select  formControlName="type" nzAllowClear nzPlaceHolder="工程类型"
                                       style="width: 170px;">
                                       <nz-option nzLabel="涉外工程" nzValue="1"></nz-option>
                                       <nz-option nzLabel="岁修工程" nzValue="2"></nz-option>
                                       <nz-option nzLabel="基建工程" nzValue="3"></nz-option>
                            </nz-select>
                        </nz-form-control>
                    </nz-form-item>
                    <nz-form-item>
                        <nz-form-label>关键词</nz-form-label>
                        <nz-form-control>
                            <input formControlName="name" nz-input placeholder="关键词"/>
                        </nz-form-control>
                    </nz-form-item>
                    <nz-form-item>
                        <nz-form-control>
                            <button nz-button nzType="primary" (click)="queryInfo()"><i nz-icon nzType="search"></i>搜索</button>
                            <button nz-button (click)="addProj()" style="margin-left: 10px">新增</button>
                        </nz-form-control>
                    </nz-form-item>
                </form>
            </div>

            <div class="table-wrap">
                <nz-table
                        #table
                        nzSize="middle"
                        nzBordered
                        [nzPageSize]="50"
                        [nzData]="tableData">
                    <thead>
                    <tr>
                        <th>工程名称</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr *ngFor="let data of table.data">
                        <td (click)="cellClick(data)">{{ data.name }}</td>
                    </tr>
                    </tbody>
                </nz-table>
            </div>
        </nz-card>
    </div>

    <div class="right">
        <nz-card [nzBordered]="false" nzTitle="工程列表">
            <div class="form-wrap">
                <form nz-form [nzLayout]="'inline'" [formGroup]="searchForm1">
                    <nz-form-item>
                        <nz-form-label>关键词</nz-form-label>
                        <nz-form-control>
                            <input [ngModelOptions]="{standalone: true}" [(ngModel)]="searchName" nz-input placeholder="关键词"/>
                        </nz-form-control>
                    </nz-form-item>
                    <nz-form-item>
                        <nz-form-control>
                            <button nz-button nzType="primary" (click)="queryInfoActive()"><i nz-icon nzType="search"></i>搜索</button>
                        </nz-form-control>
                    </nz-form-item>
                </form>
            </div>

            <div class="table-wrap">
                <nz-table
                        #table2
                        nzBordered
                        nzSize="middle"
                        [nzPageSize]="50"
                        [nzData]="tableData2">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>文件名称</th>
                        <th style="width: 400px;">附件</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr *ngFor="let data of table2.data">
                        <td>{{ data.num }}</td>
                        <td>{{ data.fileTypeName }}</td>
                        <td>{{ data.fileName }}</td>
                        <td>
                            <a (click)="openFileUploadModal(data)">上传</a>
                            <nz-divider nzType="vertical"></nz-divider>
                            <a (click)="versionManage(data)">版本管理</a>
                        </td>
                    </tr>
                    </tbody>
                </nz-table>
            </div>
        </nz-card>
    </div>


    <nz-modal [nzBodyStyle]="nzBodyStyle" nzWidth="660" [(nzVisible)]="fileModalShow" [nzTitle]="fileModalTitle"
              (nzOnCancel)="onFileCancel()" (nzOnOk)="onFileConfirm()">
        <form nz-form [formGroup]="fileUploadForm">
            <div nz-row [nzGutter]="24">
                <div nz-col [nzSpan]="12">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSm]="6" [nzXs]="24">版本号</nz-form-label>
                        <nz-form-control>
                            <input nz-input formControlName="version" placeholder="版本号">
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <!--<div nz-col [nzSpan]="12">
                  <nz-form-item nzFlex>
                    <nz-form-label [nzSm]="6" [nzXs]="24">文件名</nz-form-label>
                    <nz-form-control>
                      <input nz-input formControlName="name" placeholder="文件名">
                    </nz-form-control>
                  </nz-form-item>
                </div>-->
                <div nz-col [nzSpan]="24" style="padding-bottom: 20px;">
                    <nz-upload
                            nzType="drag"
                            nzFileType="application/pdf"
                            [(nzFileList)]="fileList"
                            (nzChange)="handleChange($event)"
                            [nzAction]="uploadUrl"
                    >
                        <p class="ant-upload-drag-icon">
                            <i nz-icon nzType="inbox"></i>
                        </p>
                        <p class="ant-upload-text">点击或者拖拽文件到此处上传</p>
                    </nz-upload>
                </div>

            </div>
        </form>
    </nz-modal>
</div>
